// 2025/8/15
// 求和

#include <iostream>
#include <vector>
using namespace std;

vector<int> seq;

void dfs(int pos, int cur, int i, int aim)
{
    if(cur == aim)
    {
        for(int j = 0; j < pos; j++)
            cout << seq[j] << " ";
        cout << endl;
        return;
    }
    if(cur > aim || i > seq.size())
        return;
    seq[pos] = i;
    dfs(pos + 1, cur + i, i + 1, aim);
    dfs(pos, cur, i + 1, aim);
}

int main() {
    int n, m;
    cin >> n >> m;
    seq.resize(n);
    dfs(0, 0, 1, m);
}
// 64 位输出请用 printf("%lld")